package com.linx;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;

import java.net.UnknownHostException;

/**
 * 启动程序
 *
 * @author Lion Li
 */
@Slf4j
@SpringBootApplication
public class LinxApplication {

    public static void main(String[] args) throws UnknownHostException {
        SpringApplication application = new SpringApplication(LinxApplication.class);
        application.setApplicationStartup(new BufferingApplicationStartup(2048));
        application.run(args);
        log.info("(♥◠‿◠)ﾉﾞ  云南建投物流国际供应链智慧园区启动成功   ლ(´ڡ`ლ)ﾞ");
    }

  /*  @Component
    public static class ServerInfoPrinter implements ApplicationListener<WebServerInitializedEvent> {

        @Autowired
        private Environment env;

        @Autowired
        private ServerProperties serverProperties;

        @Override
        public void onApplicationEvent(WebServerInitializedEvent event) {
            String ip = null;
            try {
                ip = InetAddress.getLocalHost().getHostAddress();
            } catch (UnknownHostException e) {
            }
            int port = event.getWebServer().getPort();
            String path = serverProperties.getServlet().getContextPath();
            path = path == null ? "" : path;
            System.out.println("\n--------------------------------------------------------------\n\t"
                + "Application DromaraApplication is running! Access URLs:\n\t" + "Local: \t\thttp://localhost:" + port
                + path + "/\n\t" + "External: \thttp://" + ip + ":" + port + path + "/\n\t" + "swagger-ui: \thttp://"
                + ip + ":" + port + path + "/doc.html\n\t" + "--------------------------------------------------------------");
        }
    }*/

}
